package lar.system.network.msgParser;


public class Strings 
{

	public static final String DELIMITER="\0";
		
	public static final String FINALIZER="\u0001";
	
	public static final String PEER_UP="PEER_UP";
	
	public static final String BROADCASTPLAYER="BROADCASTPLAYER";  
	
	public static final String BROADCASTGAME="BROADCASTGAME";
	
	public static final String STARTGAME="STARTGAME";
	
	public static final String STARTSAVEDGAME="STARTSAVEDGAME";
	
	public static final String UPDATE_COLOR="UPDATE_COLOR";
	
	public static final String REQUEST_JOIN="REQUEST_JOIN";
	
	public static final String UPDATE_ROUNDSNUM="UPDATE_ROUNDSNUM";
	
	public static final String JOIN_RESPONSE="JOIN_RESPONSE";
	
	public static final String GTFO = "GTFO";
	
	public static final String SAVED_CHUNK = "SAVED_CHUNK";
	
	public static final String READY="READY";
	
	public static final String FIRE="FIRE";

	public static final String DISCOVER="DISCOVER";
	
	public static final String ANS_DISCOVER="ANS_DISCOVER";
	
	public static final String CHATMSG = "CHATMSG";
	
	public static final String UPDATE_CONFIG = "UPDATE_CONFIG";
			
	//***************************** Packet Header(s) *****************************\\
	
	/** Packet. */
	public static final String PKT = "PKT";
	
	/** Acknowledge packet. */
	public static final String ACK = "ACK";
	
	/** Control packet. */
	public static final String CTRL = "CTRL";
	
	
	//**************************** General Message(s) ****************************\\
	
	/** Client's verification message. */
	public static final String HELLO = "HELLO";
	
	public static final String FATAL = "FATAL";
	
	/** Welcome player to server. */
	public static final String WELCOME = "WELCOME";
	
	/** Set game as public. */
	public static final String MAKE_PUBLIC = "MAKE_PUBLIC";
	
	/** Get list of public rooms. */
	public static final String GET_PUBLIC_LIST = "GET_PUBLIC_LIST";
	
	/** Post list of public rooms. */
	public static final String POST_PUBLIC_LIST = "POST_PUBLIC_LIST";
	
	/** Start game. */
	public static final String START_GAME = "START_GAME";
	
	/** Close connection. */
	public static final String GOOD_BYE = "GOOD_BYE";
	
	
	//*************************** Advertise Message(s) ***************************\\
	
	/** Advertise game room to server. */
	public static final String ADVERTISE = "ADVERTISE";
	
	/** Room opened successfully. */
	public static final String ADVERTISED = "ADVERTISED";
	
	/** Close advertised game room. */
	public static final String UNADVERTISE = "UNADVERTISE";
	
	/** Failed to open room. */
	public static final String ADVERTISED_ERROR = "ADVERTISED_ERROR";
	
	
	//****************************** Join Message(s) ******************************\\
	
	/** Request to join room */
	public static final String JOIN = "JOIN";
	
	/** Joined room successfully. */
	public static final String JOINED = "JOINED";
	
	/** Leave room. */
	public static final String LEAVE_ROOM = "LEAVE_ROOM";
	
	/** Room closed. */
	public static final String ROOM_CLOSED = "ROOM_CLOSED";
	
	/** Failed to join room. */
	public static final String JOINED_ERROR = "JOINED_ERROR";
	
	public static String ans_discover(String ip , String model)
	{
		return ANS_DISCOVER+" \0 "+ip+" \0 "+model;
	}
	
	public static String getIp(String s)
	{
		String[] array = s.trim().split("\0");
		return array[1];
	}
	
	public static String getModel(String s)
	{
		String[] array = s.trim().split("\0");
		return array[2];
	}
	
}
